package com.course.coursedesign2022.service;

import com.course.coursedesign2022.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EvaluateReport {
    @Autowired
    private UserMapper userMapper;
    public String evaReport(Integer id) {
        Integer isFilled = userMapper.getUserInfoById(id).getIsInfo();
        Integer bloodNum = userMapper.getUserInfoById(id).getBloodNum();
        if(isFilled==1&&bloodNum>=10){
            userMapper.evaReport(id);
            return "完成评估报告，成长积分+2";
        }
        return "个人资料未填写/血糖记录数填写次数小于10，无法获得积分";
    }
}
